Skip to content

fix(linux): persist credentials in Secret Service with keyutils as cache - #304

Merged
egdev6 merged 5 commits into
mainfrom
fix/302-linux-keyring-persistence
Nov 20, 2026
Merged

egdev6 merged 5 commits into
mainfrom
fix/302-linux-keyring-persistence

Conversation

@egdev6

@egdev6 egdev6 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Related issue / Issue relacionada

Closes #302. Spec: odd/tasks/302-linux-keyring-persistence.md (S1–S6, S3b).

Scope / Alcance

On Linux, credentials were stored with keyring linux-native = kernel keyutils, which «is completely in-memory and will not persist across reboots». This switches to keyutils as a cache plus Secret Service (GNOME Keyring / KWallet) as the persistent store.

  • src-tauri/Cargo.toml: linux-native → linux-native-sync-persistent + crypto-rust (encrypted D-Bus transfer); system libdbus, no vendored C. windows-native / apple-native unchanged.
  • src-tauri/src/secrets.rs (Linux-only, cfg(target_os = "linux")):
    • builds the combined keyutils + Secret Service credential explicitly: keyring 3.6.3's default persistent builder only returns SsCredential (keyutils_persistent.rs:170-173);
    • promotion: a value found only in keyutils (saved by older versions) is copied once into Secret Service on read, so users who update and reboot keep their keys; failures keep the read working and retry later; nothing is logged;
    • process-wide lock around reads, promotion, set and delete, so a promotion can never overwrite or resurrect a value saved/deleted concurrently; Secret Service is checked once per key per process.
    • Missing Secret Service still surfaces as an explicit error; never plain text.
  • CI / dev: libdbus-1-dev in linux-ci.yml, linux-pr-ci.yml, linux-release.yml and the devcontainer. New isolated #[ignore] smokes read directly from Secret Service (the old round trip also passed with keyutils) and are wired into the "Secret Service smoke" step of linux-ci.yml.
  • Docs: README (EN/ES) and docs/build-linux.md now describe the real store.

Dependencies: Windows and macOS dependency trees are identical to main. Newly compiled on Linux only: dbus-secret-service 4.1.0 and its crypto crates (aes, cbc, cipher, hkdf, hmac, num*, …). zbus 4/secret-service appear in Cargo.lock but are compiled on no target.

Review slices: 986517e (CI deps), 14fa47f (fix + tests, high-risk unit on its own), cdaac14 (docs), b2a2d13 (ODD log).

Acceptance and validation / Aceptación y validación

Check Result
cargo test --locked ✅ 741 passed, 10 ignored
cargo fmt --all -- --check ✅
npm test ✅ exit 0 (Vitest 1241, node 329)
actionlint v1.7.7 on the three Linux workflows ✅ exit 0
Race tests ×20 (linux_promotion, 4 threads) ✅ 20/20
Independent verification (Risk: items 2, 4, 5), two rounds ✅ no blockers; mutation probes confirm the promotion tests bite

Remaining / Pendiente

  • Run linux-ci.yml on this branch (with_bundle: tests is enough): the live Secret Service smokes only run there.
  • Windows/macOS builds not run locally (CI on this PR covers them).
  • Known minor follow-ups: a dismissed keyring unlock prompt is retried on every refresh; absent keys still search Secret Service on each read.
  • Then: release 0.9.1 and attach the Linux installers with linux-release.yml.

@egdev6 egdev6 added the type:bug Bug fix label Nov 20, 2026
@egdev6
egdev6 merged commit 36d3d7e into main Nov 20, 2026
5 checks passed
@egdev6
egdev6 deleted the fix/302-linux-keyring-persistence branch November 20, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(linux): las credenciales no persisten tras reiniciar (keyring linux-native = keyutils)

1 participant